feat(schemes): adds support for SemVer 2.0 (dot in pre-releases) (fix #1025)#1072
Merged
noirbizarre merged 1 commit intocommitizen-tools:masterfrom Apr 18, 2024
Merged
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1072 +/- ##
==========================================
+ Coverage 97.33% 97.53% +0.19%
==========================================
Files 42 55 +13
Lines 2104 2477 +373
==========================================
+ Hits 2048 2416 +368
- Misses 56 61 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
c29db83 to
23e8291
Compare
woile
approved these changes
Apr 18, 2024
Member
woile
left a comment
There was a problem hiding this comment.
Awesome work again 🎉
I'm in for a breaking change cleaning up some old deprecated flags.
Member
Author
|
I'll do a dedicated PR dropping all deprecations. Given it will breaking, maybe we should discuss what other breaking changes we want to include (like maybe #996 (comment)). |
23e8291 to
d30fa81
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a
semver2version scheme which is applying strictprereleaseformatting as described in SemVer 2 Item 9 and Semver 2.0.0 Item 11, meaning:As a consequence, the
1.2.3-alpha0form is not respecting those rules (1.2.3-alpha10has not proper precedence over1.2.3-alpha2), nor1.2.3-alpha.0-dev.0as its prerelease identifiers will bealpha,0-dev,0while it should bealpha,0,devand0.Note that Semver 2 is underspecified on this point (there is no formal description of what are the expected prerelease identifiers, only example) and so this PR chose to stay close to the examples (use of
alphaandbetainstead ofaandb), but this is choice, not a specification requirement.Checklist
./scripts/formatand./scripts/testlocally to ensure this change passes linter check and testExpected behavior
SemVer 2.0 versions are properly parsed and bumped, the resulting version is SemVer 2,0 compliant too.
Steps to Test This Pull Request
version_scheme = "semver2"in you commitizen configx.y.z-dev.Dx.y.z-alpha.Ax.y.z-alpha.A.dev.DAdditional context
Fixes #1025
Note
I think it's time for removing the
version-typedeprecated byvesion-scheme(in another PR)